﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/admin/AdminMaster.master" ValidateRequest="false" CodeFile="addLWMakeAdm.aspx.cs" Inherits="admin_addLWMakeAdm" %>

<%@ Register Assembly="DotNetTextBox" Namespace="DotNetTextBox" TagPrefix="DNTB" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="AdminRight">
    <div class="rightHeader1">
        <div class="rightHLeft"><span class="rightHeaderTitle">当前位置</span></div>
        <div class="rightHMiddle2">
            <span>
                <a href="Default.aspx" class="moreRight" style="float: left;">首页</a> <span class="jian">></span>
                <a href="LWMakeAdm.aspx" class="moreRight" style="float: left;">论文</a><span class="jian">></span>
                <a href="addLWMakeAdm.aspx" class="moreRight" style="float: left;">添加论文</a>
            </span>
        </div>
        <div class="rightHRight"></div>
    </div>
    <div style="margin-top: 10px; border: 1px solid #dddddd; width: 760px;">
        <asp:DetailsView ID="DetailsView1" runat="server"
            AutoGenerateRows="False" DataKeyNames="lwid" DataSourceID="SqlDataSource2"
            Height="50px" Width="760px" BackColor="White" BorderColor="#DEDFDE"
            BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black"
            GridLines="Both" OnDataBound="DetailsView1_DataBound"
            DefaultMode="Insert">
            <FooterStyle BackColor="#1f93e0" ForeColor="#333333" />
            <RowStyle BackColor="White" ForeColor="#333333" />
            <PagerStyle BackColor="#1f93e0" ForeColor="#FFFFFF" HorizontalAlign="Center" />
            <Fields>
                <asp:TemplateField HeaderText="标题" SortExpression="lwtitle">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                            ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                            ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("lwtitle") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="lwtime" DataFormatString="{0:d}" HeaderText="时间"
                    SortExpression="lwtime" InsertVisible="False" ReadOnly="True" />
                <asp:TemplateField HeaderText="类别" SortExpression="lwcname">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server"
                            DataSourceID="SqlDataSource1" DataTextField="lwcname" DataValueField="lwcid"
                            SelectedValue='<%# Bind("lwcid") %>'>
                        </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server"
                            DataSourceID="SqlDataSource1" DataTextField="lwcname" DataValueField="lwcid"
                            SelectedValue='<%# Bind("lwcid") %>'>
                        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("lwcname") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="内容" SortExpression="lwcontent">
                    <EditItemTemplate>
                        <DNTB:WebEditor ID="WebEditor1" runat="server" AdjustSize="50"
                            BackColor="White" BorderColor="#DDDDDD" BorderWidth="0px"
                            CodeBackColor="#E8F4FF" CodeBorder="1px" CodeBorderColor="#6595D6"
                            CodeBorderStyle="Dotted" CodeTitle="以下是代码片段：" EditBorderColor="#CDCDD3"
                            EditHeight="210px" Height="280px" LeftAreaAlign="center" LeftAreaWidth="36%"
                            QuoteBackColor="#E8F4FF" QuoteBorder="1px" QuoteBorderColor="#6595D6"
                            QuoteBorderStyle="Dotted" QuoteTitle="以下是引用片段：" RightAreaAlign="center"
                            RightAreaWidth="64%" Shadow="False" StatusHeight="20px"
                            systemFolder="system_dntb/" Text='<%# Bind("lwcontent") %>'
                            ToolBarColor="#EFEFEF" ToolBarHeight="50px" Width="555px" />
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <DNTB:WebEditor ID="WebEditor1" runat="server" AdjustSize="50"
                            BackColor="White" BorderColor="#DDDDDD" BorderWidth="0px"
                            CodeBackColor="#E8F4FF" CodeBorder="1px" CodeBorderColor="#6595D6"
                            CodeBorderStyle="Dotted" CodeTitle="以下是代码片段：" EditBorderColor="#CDCDD3"
                            EditHeight="210px" Height="280px" LeftAreaAlign="center" LeftAreaWidth="36%"
                            QuoteBackColor="#E8F4FF" QuoteBorder="1px" QuoteBorderColor="#6595D6"
                            QuoteBorderStyle="Dotted" QuoteTitle="以下是引用片段：" RightAreaAlign="center"
                            RightAreaWidth="64%" Shadow="False" StatusHeight="20px"
                            systemFolder="system_dntb/" Text='<%# Bind("lwcontent") %>'
                            ToolBarColor="#EFEFEF" ToolBarHeight="50px" Width="555px" />
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("lwcontent") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <InsertItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True"
                            CommandName="Insert" Text="插入"></asp:LinkButton>
                        &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False"
                            PostBackUrl="~/admin/LWMakeAdm.aspx" Text="浏览"></asp:LinkButton>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                            CommandName="New" Text="新建"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Fields>
            <HeaderStyle BackColor="#1f93e0" Font-Bold="True" ForeColor="#FFFFFF" />
            <EditRowStyle BackColor="#FFFFFF" Font-Bold="True" ForeColor="#333333" />
            <AlternatingRowStyle BackColor="White" />
        </asp:DetailsView>
    </div>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwclass] WHERE [lwcid] = @original_lwcid"
        InsertCommand="INSERT INTO [lwclass] ([lwcname]) VALUES (@lwcname)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwclass]"
        UpdateCommand="UPDATE [lwclass] SET [lwcname] = @lwcname WHERE [lwcid] = @original_lwcid">
        <DeleteParameters>
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwcname" Type="String" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwcname" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwinfo] WHERE [lwid] = @original_lwid AND [lwtitle] = @original_lwtitle AND [lwcontent] = @original_lwcontent AND [lwtime] = @original_lwtime AND [lwcid] = @original_lwcid"
        InsertCommand="INSERT INTO [lwinfo] ([lwtitle], [lwcontent], [lwtime], [lwcid]) VALUES (@lwtitle, @lwcontent, @lwtime, @lwcid)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwinfo]"
        UpdateCommand="UPDATE [lwinfo] SET [lwtitle] = @lwtitle, [lwcontent] = @lwcontent, [lwtime] = @lwtime, [lwcid] = @lwcid WHERE [lwid] = @original_lwid AND [lwtitle] = @original_lwtitle AND [lwcontent] = @original_lwcontent AND [lwtime] = @original_lwtime AND [lwcid] = @original_lwcid">
        <DeleteParameters>
            <asp:Parameter Name="original_lwid" Type="Int32" />
            <asp:Parameter Name="original_lwtitle" Type="String" />
            <asp:Parameter Name="original_lwcontent" Type="String" />
            <asp:Parameter Name="original_lwtime" Type="DateTime" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwtime" Type="DateTime" />
            <asp:Parameter Name="lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwid" Type="Int32" />
            <asp:Parameter Name="original_lwtitle" Type="String" />
            <asp:Parameter Name="original_lwcontent" Type="String" />
            <asp:Parameter Name="original_lwtime" Type="DateTime" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwtime" Type="DateTime" />
            <asp:Parameter Name="lwcid" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwinfo] WHERE [lwid] = @original_lwid"
        InsertCommand="INSERT INTO [lwinfo] ([lwtitle], [lwcontent], [lwtime], [lwcid]) VALUES (@lwtitle, @lwcontent,getdate(), @lwcid)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT lwinfo.lwid, lwinfo.lwtitle, lwinfo.lwcontent, lwinfo.lwtime, lwinfo.lwcid, lwclass.lwcname FROM lwinfo INNER JOIN lwclass ON lwinfo.lwcid = lwclass.lwcid"
        UpdateCommand="UPDATE [lwinfo] SET [lwtitle] = @lwtitle, [lwcontent] = @lwcontent,[lwcid] = @lwcid WHERE [lwid] = @original_lwid">
        <DeleteParameters>
            <asp:Parameter Name="original_lwid" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwid" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwtitle" Type="String" />
            <asp:Parameter Name="lwcontent" Type="String" />
            <asp:Parameter Name="lwcid" Type="Int32" />
        </InsertParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConflictDetection="CompareAllValues"
        ConnectionString="<%$ ConnectionStrings:DB_CCXYRCConnectionString %>"
        DeleteCommand="DELETE FROM [lwclass] WHERE [lwcid] = @original_lwcid AND [lwcname] = @original_lwcname"
        InsertCommand="INSERT INTO [lwclass] ([lwcname]) VALUES (@lwcname)"
        OldValuesParameterFormatString="original_{0}"
        SelectCommand="SELECT * FROM [lwclass]"
        UpdateCommand="UPDATE [lwclass] SET [lwcname] = @lwcname WHERE [lwcid] = @original_lwcid AND [lwcname] = @original_lwcname">
        <DeleteParameters>
            <asp:Parameter Name="original_lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwcname" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="lwcname" Type="String" />
            <asp:Parameter Name="original_lwcid" Type="Int32" />
            <asp:Parameter Name="original_lwcname" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="lwcname" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
</asp:Content>

